# 2. selenium操作浏览器
# 	在搜狗（https://www.sogou.com/）搜索天气预报
from selenium import webdriver
import time
from selenium.webdriver.common.by import By

class Browser_sogo():
    def __init__(self):
        self.driver=webdriver.Chrome()
        self.driver.get('https://www.sogo.com')

    def search_weather_forecast(self):
        self.driver.find_element(By.ID,'query').send_keys('天气预报')
        self.driver.find_element(By.ID,'stb').click()

    def quit(self):
        time.sleep(5)
        self.driver.quit()

if __name__=='__main__':
    bo = Browser_sogo()
    bo.search_weather_forecast()
    bo.quit()









